package com.pcbly.web.persistence.property;

import java.util.List;

import com.pcbly.web.bean.PropertyLocalizedBean;
import com.pcbly.web.persistence.HibernateBaseDao;

public class PropertyLocalizedHibernateDao extends
		HibernateBaseDao<PropertyLocalizedBean> implements PropertyLocalizedDao {

	/**
	 * 
	 */
	private static final long serialVersionUID = 410235506881364556L;
	public PropertyLocalizedHibernateDao(){
		super();
	}
	protected Class<PropertyLocalizedBean> getEntityClass() {
		return PropertyLocalizedBean.class;
	}

	@Override
	public void insert(PropertyLocalizedBean bean) throws Exception {
		// TODO Auto-generated method stub
		getHibernateTemplate().save(bean);
	}

	@SuppressWarnings("unchecked")
	public List<PropertyLocalizedBean> findListByName(String name) throws Exception {
		List<PropertyLocalizedBean> list = getSession().createSQLQuery(
				"select * from sys_propertylocalized where NAME_ like '%"
						+ name + "%'").addEntity(PropertyLocalizedBean.class)
				.list();
		return list;
	}
}
